package com.own.business.exam.entity.dto;


import com.own.business.exam.entity.bo.ExamRuleAccountBo;
import com.own.component.common.base.entity.BaseDto;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * ExamRuleAccountDto
 *
 * @author 陈学礼 （你是一段成熟的代码，要学会自己改bug）
 * @version 4.0.0
 * @date 2021/05/18 14:43:47
 * @since 4.0.0
 */
@ApiModel("考试规则指定账号表" + ConstantBeanSuffix.DTO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamRuleAccountDto extends BaseDto<ExamRuleAccountBo> {

    @ApiModelProperty("规则id")
    private Long ruleId;

    @ApiModelProperty("试卷名称")
    private String account;

    /**
     * 转业务层对象
     *
     * @param entity 原业务层对象
     * @return 业务层对象
     */
    @Override
    public ExamRuleAccountBo toBo(ExamRuleAccountBo entity) {
        if (entity == null) {
            entity = new ExamRuleAccountBo();
        }
        entity.setRuleId(ruleId);
        entity.setAccount(account);
        return super.toBo(entity);
    }

}
